$(document).ready(function(){
	init();
});

function init(){
    $('.button').button();
    $( "#quoteDiv" ).dialog({
		autoOpen: false,
		show: "blind",
		hide: "explode"
	});
    $('#quoteButton').click(function(){getQuote(this);})
}
function getQuote(o){
	d = new Date();
	$.getJSON($(o).attr('url')+ '?r=' + (d.getTime()),function(data){
		$('#quote').html(data['quote']);
		$('#quoteDiv').dialog('open');
	});
	
}